﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.DynamicData.ModelProviders;

namespace DD.NHibernateProvider
{
    public class NHibernateColumnProvider : ColumnProvider
    {
        public NHibernateColumnProvider(NHibernateTableProvider table, NHibernate.Mapping.Column column, bool isPrimaryKey)
            : base(table)
        {
            this.Name = column.Name;
            this.Nullable = column.IsNullable;
            this.MaxLength = column.Length;
            this.ColumnType = column.Value.Type.ReturnedClass;
            this.IsSortable = true;
            this.IsPrimaryKey = isPrimaryKey;
            //this.EntityTypeProperty = property.PersistentClass.MappedClass.GetProperty(property.Name);
        }
    }
}
